﻿@using System.Globalization
@using Abp.AspNetZeroCore.Timing
@using Abp.Web.Security.AntiForgery
@using MyCompanyName.AbpZeroTemplate.Web.Theme
@using CultureHelper = MyCompanyName.AbpZeroTemplate.Localization.CultureHelper
@model MyCompanyName.AbpZeroTemplate.Web.Models.Install.InstallViewModel
@inject AppTimes AppTimes
@inject IAbpAntiForgeryManager AbpAntiForgeryManager
@{
    Layout = null;
    AbpAntiForgeryManager.SetCookie(Context);
}
<!DOCTYPE html>
<html lang="en">
<head>
    <title>AbpZeroTemplate Installation</title>

    <link rel="shortcut icon" href="~/favicon.ico" />
    <link rel="stylesheet" abp-href="/view-resources/Areas/AppAreaName/Views/_Bundles/vendors.bundle.css" asp-append-version="true" />
    <link rel="stylesheet" href="/metronic/dist/html/default/assets/demo/default/base/style.bundle.css" asp-append-version="true" />
    <link rel="stylesheet" abp-href="/view-resources/Areas/AppAreaName/Views/_Bundles/app-layout-libs.css" asp-append-version="true" />
    <link rel="stylesheet" abp-href="/view-resources/Areas/AppAreaName/Views/_Bundles/common-styles.css" asp-append-version="true" />

    @if (CultureHelper.IsRtl)
    {
        <link rel="stylesheet" href="/Common/Styles/abp-zero-template-rtl.css" asp-append-version="true" />
    }

    <link rel="stylesheet" abp-href="/view-resources/Views/Install/Index.css" asp-append-version="true" />
</head>
<body class="m-page--boxed m-body--fixed m-header--static m-aside--offcanvas-default" style="background-image: url('/metronic/src/media/app/img/bg/bg-1.jpg');">
    <div class="content">
        <div class="m-content">
            <div class="m-portlet m-portlet--mobile">
                <div class="m-portlet__head">
                    <div class="m-portlet__head-caption">
                        <div class="m-portlet__head-title">
                            <h3 class="m-portlet__head-text">
                                AbpZeroTemplate Installation
                            </h3>
                        </div>
                    </div>
                </div>
                <form id="installForm" class="m-form m-form--fit">
                    <div class="m-portlet__body">
                        <div class="form-group m-form__group">
                            <div class="m-alert m-alert--icon alert alert-warning" role="alert">
                                <div class="m-alert__icon">
                                    <i class="la la-warning" aria-label="Warning"></i>
                                </div>
                                <div class="m-alert__text">
                                    <strong>
                                        Clear your cookies before installing AbpZeroTemplate ! Otherwise, you might have some problems.
                                    </strong>
                                </div>
                            </div>
                        </div>
                        <div class="m-form__section">
                            <div class="m-form__heading">
                                <h5 class="m-form__heading-title">
                                    Connection String
                                </h5>
                            </div>
                            <div class="form-group m-form__group">
                                <input type="text" class="form-control" name="connectionString" autocomplete="off" placeholder="Connection string" required>
                            </div>
                            <div class="m-form__seperator m-form__seperator--dashed"></div>
                            <div class="m-form__heading">
                                <h5 class="m-form__heading-title">
                                    Admin Password
                                </h5>
                            </div>
                            <div class="form-group m-form__group">
                                <input type="password" class="form-control" id="adminPassword" name="adminPassword" autocomplete="off" placeholder="Admin password" required>
                            </div>
                            <div class="form-group m-form__group">
                                <input type="password" class="form-control" id="adminPasswordRepeat" name="adminPasswordRepeat" autocomplete="off" placeholder="Admin password again" required>
                            </div>
                            <div class="m-form__seperator m-form__seperator--dashed"></div>
                            <div class="m-form__heading">
                                <h5 class="m-form__heading-title">
                                    Web Site Url
                                </h5>
                            </div>
                            <div class="form-group m-form__group">
                                <input type="text" class="form-control" name="webSiteUrl" value="@Model.AppSettingsJson.WebSiteUrl" placeholder="Web site URL">
                            </div>
                            <div class="m-form__seperator m-form__seperator--dashed"></div>
                            <div class="m-form__heading">
                                <h5 class="m-form__heading-title">
                                    Default Language
                                </h5>
                            </div>
                            <div class="form-group m-form__group">
                                <select class="form-control" name="defaultLanguage">
                                    @foreach (var language in Model.Languages)
                                    {
                                        <option value="@language.Name">@language.DisplayName</option>
                                    }
                                </select>
                            </div>
                            <div class="m-form__seperator m-form__seperator--dashed"></div>
                            <div class="m-form__heading">
                                <h5 class="m-form__heading-title">
                                    SMTP Settings
                                </h5>
                            </div>
                            <div class="form-group m-form__group">
                                <input type="text" class="form-control" name="defaultFromAddress" placeholder="Default from address">
                            </div>
                            <div class="form-group m-form__group">
                                <input type="text" class="form-control" name="defaultFromDisplayName" placeholder="Default from displayName">
                            </div>
                            <div class="form-group m-form__group">
                                <input type="text" class="form-control" name="smtpHost" placeholder="SMTP host">
                            </div>
                            <div class="form-group m-form__group">
                                <input type="text" class="form-control edited" name="smtpPort" value="" placeholder="SMTP port">
                            </div>
                            <div class="form-group m-form__group">
                                <label class="control-label col-md-12"></label>
                                <div class="m-checkbox-list">
                                    <label class="m-checkbox">
                                        <input id="Settings_SmtpEnableSsl" type="checkbox" name="smtpEnableSsl" value="true">
                                        UseSsl
                                        <span></span>
                                    </label>
                                    <label class="m-checkbox">
                                        <input id="Settings_SmtpUseDefaultCredentials" type="checkbox" name="smtpEnableSsl" value="true">
                                        Use Default Credentials
                                        <span></span>
                                    </label>
                                </div>
                            </div>
                            <div class="form-group m-form__group">
                                <input type="text" class="form-control edited" name="smtpDomain" placeholder="Domain name">
                            </div>
                            <div class="form-group m-form__group">
                                <input type="text" class="form-control edited" name="smtpUserName" placeholder="User name">
                            </div>
                            <div class="form-group m-form__group">
                                <input type="password" class="form-control edited" name="smtpPassword" id="SmtpPassword" placeholder="Password" autocomplete="off">
                            </div>
                            <div class="m-form__seperator m-form__seperator--dashed"></div>
                            <div class="m-form__heading">
                                <h5 class="m-form__heading-title">
                                    Invoice Info
                                </h5>
                            </div>
                            <div class="form-group m-form__group">
                                <input type="text" class="form-control" name="legalName" placeholder="Legal name">
                            </div>
                            <div class="form-group m-form__group">
                                <textarea class="form-control" name="billAddress" rows="5" placeholder="Address"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="m-portlet__foot m-portlet__no-border m-portlet__foot--fit">
                        <div class="m-form__actions m-form__actions--solid">
                            <button id="SaveButton" class="btn btn-primary">Save</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <script abp-src="/view-resources/Areas/AppAreaName/Views/_Bundles/app-layout-libs.js" asp-append-version="true"></script>
    <script abp-src="/view-resources/Areas/AppAreaName/Views/_Bundles/scripts.bundle.js" asp-append-version="true"></script>

    <!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
    <script src="/AbpServiceProxies/GetAll?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>

    <script type="text/javascript">
    abp.localization.currentCulture = $.extend({}, abp.localization.currentCulture, { displayNameEnglish: '@CultureInfo.CurrentUICulture.EnglishName' });
    </script>

    <script abp-src="/view-resources/Areas/AppAreaName/Views/_Bundles/common-scripts.js" asp-append-version="true"></script>
    <script abp-src="/view-resources/Views/Install/Index.js" asp-append-version="true"></script>
</body>
</html>
